import java.util.Scanner;

public class Ex5_21{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		System.out.print("Enter ten numbers: ");
		double[] data = new double[10];
		for (int i = 0; i < 10; i++){
			data[i] = input.nextDouble();
		}
		System.out.printf("The mean is %.2f\n", mean(data));
		System.out.printf("The standard deviation is %.5f\n", deviation(data));
	}

	public static double mean(double[] data){
		double sum = 0;
		double n = data.length;

		for (double d:data){
			sum += d;
		}
		return sum / n;
	}

	public static double deviation(double[] data){
		double sum = 0;
		double n = data.length;
		double m = mean(data);

		for (double d:data){
			sum += d * d;
		}
		return Math.pow((sum - m*m*n) / (n-1), 0.5);
	}
}
